/**
 * @file main.cpp
 *
 *  Created on: 07/10/2011
 *      Author: Tales
 */
#include "common.hpp"
#include "config.hpp"
#include "core/game.hpp"
#include <memory>
#include "video/Screen.hpp"
#if YEP_RUN_MODE == 0
#   include "game_test.hpp"
#else //YEP_RUN_MODE == 1
#   include "application/ApplicationScene.hpp"
#endif

using namespace yep;

int main( int argc, char *argv[] )
{
    //Initializer everything
    if( SDL_Init( SDL_INIT_EVERYTHING ) < 0 ) {
        //If anything goes wrong, break;
        cout << u8"Fatal Initialization error: " << SDL_GetError() << endl;
        return EXIT_FAILURE;
        // TODO (Tales#5#): Test subsystems that which subsystems weren't loaded
    }

    atexit( SDL_Quit ); // To not forget to free the resources corArealy.
    //Discover the game
    Game &game( Game::getInstance() );
    Screen::getInstance().setCaption("BedTest");
#if YEP_RUN_MODE == 0
    GameTest gameTest;
    game.setCurrentScene(gameTest);
#else
    ApplicationScene applicationScene;
    game.setCurrentScene(applicationScene);
#endif
    game.run();
    return EXIT_SUCCESS;
}



